From 8583d2dbeb911fe85599c7097f49f2270e8689fd Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Wed, 1 Oct 2025 14:43:26 -0400 Subject: [PATCH] ncbi-blast+ 2.17.0+ds-2: Fix ZCF CRC32C logistics with SIMDE help. * debian/control: - Additionally build-depend on libsimde-dev. - Require CRC support on ARM per upstream. * debian/patches/zcf-simde-crc32c (new): Replace Cloudflare deflate.c's fallbackless architecture-dependent code with a SIMDE invocation that amounts to the same thing on supported architectures and to a portable fallback elsewhere. --- debian/changelog | 12 ++++++++++++ debian/control | 2 ++ debian/patches/series | 1 + debian/patches/zcf-simde-crc32c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 debian/patches/zcf-simde-crc32c diff --git a/debian/changelog b/debian/changelog index 71c30de6..c1ac8977 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +ncbi-blast+ (2.17.0+ds-2) unstable; urgency=medium + + * debian/control: + - Additionally build-depend on libsimde-dev. + - Require CRC support on ARM per upstream. + * debian/patches/zcf-simde-crc32c (new): Replace Cloudflare deflate.c's + fallbackless architecture-dependent code with a SIMDE invocation that + amounts to the same thing on supported architectures and to a portable + fallback elsewhere. + + -- Aaron M. Ucko Wed, 01 Oct 2025 14:43:25 -0400 + ncbi-blast+ (2.17.0+ds-1) unstable; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index 7234c3e6..4e04f26c 100644 --- a/debian/control +++ b/debian/control @@ -20,6 +20,7 @@ Build-Depends-Arch: libncbi-vdb-dev [amd64 arm64 x32], libnghttp2-dev, libpcre2-dev, + libsimde-dev, libsqlite3-dev, libuv1-dev, time, @@ -34,6 +35,7 @@ Package: ncbi-blast+ Architecture: any Multi-Arch: foreign Depends: + armv8crc-support [any-arm arm64], ncbi-data, python3, sse4.2-support [any-amd64 any-i386 any-x32], diff --git a/debian/patches/series b/debian/patches/series index 5c34fb88..a4fb8620 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,3 +22,4 @@ tune_lmdb_defaults 2to3 big_endian_workaround # fix_bm_for_gcc15 +zcf-simde-crc32c diff --git a/debian/patches/zcf-simde-crc32c b/debian/patches/zcf-simde-crc32c new file mode 100644 index 00000000..939b1387 --- /dev/null +++ b/debian/patches/zcf-simde-crc32c @@ -0,0 +1,32 @@ +--- a/c++/src/util/compress/zlib_cloudflare/deflate.c ++++ b/c++/src/util/compress/zlib_cloudflare/deflate.c +@@ -129,27 +129,11 @@ static const config configuration_table[ + /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ + #define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) + +-#ifdef __aarch64__ +- +-#include +-#include +-static uint32_t hash_func(deflate_state *s, void* str) { +- return __crc32cw(0, *(uint32_t*)str) & s->hash_mask; +-} +- +-#elif defined __x86_64__ || defined _M_AMD64 +- +-#include ++#include + static uint32_t hash_func(deflate_state *s, void* str) { +- return _mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask; ++ return simde_mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask; + } + +-#else +- +-#error "Only 64-bit Intel and ARM architectures are supported" +- +-#endif +- + /* =========================================================================== + * Insert string str in the dictionary and return the previous head + * of the hash chain (the most recent string with same hash key). -- 2.30.2